<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
$this->load->helper('url');
?><!DOCTYPE html>
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="/static/css/animate.css">
	<link rel="stylesheet" href="/static/plugin/jquery-ui/jquery-ui.min.css" />
	<link rel="stylesheet" href="/static/plugin/font-awesome/css/font-awesome.min.css" />
	<link rel="stylesheet" href="/static/css/style.css?<?php echo $t;?>">
	<link rel="stylesheet" href="/static/css/user.css?<?php echo $t;?>">
	<script src="/static/js/jquery-1.10.2.min.js"></script>
	
	<script src="/static/plugin/jquery-ui/jquery-ui.min.js"></script>
	<script src="/static/plugin/layer/layer.js"></script>
	<script src="/static/js/jquery.form.min.js"></script>
	<script src="/static/js/extend.js"></script>
	</head>
	
	<body>
	<div class="form-title"><?php echo lang('user_mobile_tit');?></div>
      
      <div class="form">
      	<div class="form-notice">您正在为账户 <strong><?php echo email($user['email']);?></strong> 绑定手机</div>
        <form id="form_id" action="<?php echo site_url('safe/mobile_do');?>" method="post">
			<table>
			
<?php
if ($user['mobile']) {
?>			<tr>
		    <th><?php echo lang('user_old_mobile_code');?></th>
			<td><input type="text" name="old_mobile_captcha" class="captcha_txt"><p><?php echo lang('user_old_mobile_code_warn');?></p><a id="send_old" class="captcha_btn"><?php echo lang('user_mobile_btn');?></a></td>
			</tr>
			<?php
}

?>			<tr>
            <th width="70"><?php echo lang('user_area');?></th>
		    <td>
		    <select name="area_code" id="area_id">
		    	
<?php
foreach ($area as $v) {
?>		    	<option value="<?php echo $v['code'];?>" 
<?php
	if ($v['is_default'] == 1) {
?>selected<?php
	}

?>><?php echo $v['name'];?></option>
		    	<?php
}

?>		    </select>
		    <p><?php echo lang('user_area_warn');?></p></td>
			<td width="70"></td>
			</tr>
			<tr>
            <th width="70"><?php echo lang('user_mobile');?></th>
		    <td><span id="area_code" class="area_code">+86</span><input type="text" class="new_mobile" name="mobile"><p><?php echo lang('user_mobile_warn');?></p></td>
			<td width="70"></td>
			</tr>
			<tr>
		    <th><?php echo lang('user_mobile_code');?></th>
		    <td><input type="text" name="mobile_captcha" class="captcha_txt"><p><?php echo lang('user_mobile_code_warn');?></p><a id="send" class="captcha_btn"><?php echo lang('user_mobile_btn');?></a></td>
			</tr>
			<tr>
			<th></th><td><button type="submit"><?php echo lang('user_submit');?></button></td>
			</tr>
		  </table>
		</form>
      </div>
      
</body>
</html>
<script>
$(function(){
	$('#form_id').winForm();
	$('#area_id').change(function(){
		var code = $(this).val();
		$('#area_code').text('+'+code);
	});
});
</script>
<script type="text/javascript">
$(function(){
	$('#send').sendMobile('<?php echo site_url('tool/mobile_owner');?>','[name="mobile"]','cn');
	$('#send_old').sendMobile('<?php echo site_url('tool/mobile_safe');?>','','cn');
});
</script>